//
//  ASJGestureRecoginzer.h
//  ASJ001
//
//  Created by zephyrhan on 11/13/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import "cocos2d.h"
#import "ASJUniqueSkill.h"


#define GESTURE_RECOGNIZED  @"GESTURE_RECOGNIZED"


@interface ASJGestureRecoginzer : CCLayer {
    
    CCLayer* hostLayer;
    
    BOOL showTrace; // default YES
    ASJGestureType supportedGestures; // use or to support multiple gestures like ASJGESTYPE_SKILL1|ASJGESTYPE_SKILL2
    
    CCLabelTTF *label;
    CGPoint startPoint;
    CGPoint startPointSameX;
    NSMutableArray *points;  //存放所有的点
    CGRect circle;
    //检测拐点
    CGPoint     lastPreviousPoint;
    CGPoint     lastCurrentPoint;
    CGFloat     lineLengthSoFar;
    
    int     numOfInflectionPoints; //拐点总数
    int     numOfLargerThanPrevious;
    int     numOfSmallerThanPrevious;
    BOOL   ifIsVertical;
    
    //    NSMutableArray  *spriteArray;
    int tagOfSprite;
    
    CGPoint currentPosition;
    CGPoint previousPoint;
    
    CCSpriteBatchNode* spriteSheet;
    NSMutableArray *increasePointsX;     //x递增的数组
    NSMutableArray *reducePointsx;       //X递减的数组
    NSMutableArray *increasePointsY;
    NSMutableArray *reducePointsY;      //Y递减的数组
    NSMutableArray *deltaYTooLarge;     //Y的增量过大
    NSMutableArray *angleInControl;
    NSMutableArray *angelInControl2;    //存放竖直角度>130
    
    NSMutableArray *ArrayForInflectionpoint;  //存放拐点
    BOOL isInflection;
    
    int  numOfIncreasePointsX;   //X坐标递增点的个数
    int  numOfIncreasePointsY;   //Y坐标递增点的个数
    int  numOfReducePointsX;     //X坐标递减点的个数
    int  numOfReducePointsY;     //Y坐标递减点的个数
    
    
    int  numOfLightsInflection;  //记录闪电 的拐点
    int  numOfCharacterE;        //记录E的拐点
    int  numOfCharacterM;
    int  numOfCircleInflection;
    int  numOfChineseknot;
    int  numOfIncreasePointsYForknot; //用于中国结测试
    int  numOfReducePointsYForknot;
    int  numOfIncreasePointsXForknot;
    int  numOfReducePointsXForknot;
    
    //划效果
    //    std::list<CGPoint> pointlist;
    NSMutableArray *pointlist;
    int pointcount;
    float linewidth;
    float linewidthinc;
    
}

@property (nonatomic, assign) CCLayer* hostLayer;
@property BOOL showTrace;

@property (retain) NSMutableArray *points;
@property (retain) NSMutableArray *increasePointsArray;

@end
